<template>
  <view class="wallet">
    <view class="header flex flex-bt">
      <text class="fs-32 bold">我的钱包</text>
      <view @click="toDetail" class="flex flex-a-c">
        <text class="more fs-28">查看更多</text>
        <u-icon name="arrow-right" size="12" color="#959595"></u-icon>
      </view>
    </view>
    <view class="count">
      <view class="name flex flex-a">
        <image
          src="../../../assets/images/setting/remain.png"
          style="width:40rpx;height: 40rpx;margin-right: 16rpx;"
          mode="scaleToFill"
        />
        <text class="c-80 fs-28">账户余额（元）</text>
      </view>
      <text class="c-90 fs-40 num bold">{{ asset.balance || 0 }}</text>
    </view>
    <view class="list flex flex-bt">
      <view class="item flex flex-c">
        <text class="title"> 可提现金额（元） </text>
        <text class="num">{{ asset.balance || 0 }}</text>
      </view>
      <view class="item flex flex-c">
        <text class="title"> 已提现金额（元） </text>
        <text class="num">{{ asset.alreadyCashMoney || 0 }}</text>
      </view>
      <view class="item flex flex-c">
        <text class="title"> 提现中（元） </text>
        <text class="num">{{ asset.cashingMoney || 0 }}</text>
      </view>
    </view>
  </view>
</template>
<script>
export default {
  props: {
    userinfo: {
      type: Object,
      default: () => {},
    },
    asset:{
      type:Object,
      default:()=>{
        return {
          balance:0,
          canCashOutMoney:0,
          alreadyCashMoney:0,
          cashingMoney:0
        }
      } 
    }
  },
  data() {
    return {
    };
  },
  onShow(){
    console.log('======>sssss')
  },
  methods: {
    toDetail() {
      if (!this.userinfo.userId) {
        return uni.navigateTo({
          url: "/pages/login/index",
        });
      }
      uni.navigateTo({
        url: "/pages/mine/wallet/index",
      });
    },
  },
};
</script>
<style lang="less" scoped>
@import url("../../../assets/styles/common.less");
.wallet {
  padding: 32rpx;
  background: #fff;
  border-radius: 16rpx;
  margin-top: 24rpx;
  .header {
    .more {
      color: rgba(7, 11, 28, 0.4);
      margin-right: 8rpx;
    }
  }
  .count {
    .name {
      margin: 16rpx 0;
    }
    .num {
      line-height: 40rpx;
    }
  }
  .list {
    margin-top: 28rpx;
    .item {
      .title {
        font-size: 24rpx;
        color: rgba(7, 11, 28, 0.6);
      }
      .num {
        font-size: 28rpx;
        color: rgba(7, 11, 28, 0.9);
        margin-top: 16rpx;
        font-weight: bold;
      }
    }
  }
}
</style>
